package copyengine.network.roomStructure.executeLayer.component
{
	import copyengine.GameFacade;
	import copyengine.network.roomStructure.executeLayer.CENetworkRoomExecuteHandleNotification;
	import copyengine.network.roomStructure.executeLayer.CENetworkRoomModelConfig;
	import copyengine.utils.debug.CELog;
	
	import flash.events.Event;

	public final class CENetworkExecuteHandleSubErrorHandleComponent
	{
		public function CENetworkExecuteHandleSubErrorHandleComponent()
		{
		}

		public function onExecuteError(_warpType:int, e:Event):void
		{
			CELog.err("CENetworkExecuteHandleSubErrorHandleComponent -> system catch an error");
			if (_warpType == CENetworkRoomModelConfig.EXECUTE_WARP_TYPE_RTMFP)
			{
				GameFacade.instance.sendNotification(CENetworkRoomExecuteHandleNotification.NOTIFICATION_SYSTEM_CATCH_AN_ERROR,
													 {
														 errorType:CENetworkRoomExecuteHandleNotification.ERROR_TYPE_RTMFP_CHANEL,
														 error:e
													 });
			}
			else if (_warpType == CENetworkRoomModelConfig.EXECUTE_WARP_TYPE_SOCKET)
			{
				GameFacade.instance.sendNotification(CENetworkRoomExecuteHandleNotification.NOTIFICATION_SYSTEM_CATCH_AN_ERROR,
													 {
														 errorType:CENetworkRoomExecuteHandleNotification.ERROR_TYPE_SOCKET_CHANEL,
														 error:e
													 });
			}
			else
			{
				CELog.err("CENetworkExecuteHandleSubErrorHandleComponent->onExecuteError unknow warpType : " + _warpType);
			}
		}
	}
}
